<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="back iconfont icon-xiangzuo1" @tap="backPage"></view>
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">{{Lang.lang('交易密碼')}}</view>
			<view class="back"></view>
			<!-- <view class="rule">规则</view> -->
		</view>
		<view class="clear_box"></view>

		<view class="page_content">
			<view class="personal_list">
				<view class="title">{{Lang.lang('新密碼')}}:</view>
				<input type="password" placeholder-style="color: #A5A7AD" v-model="pwd" :placeholder="Lang.lang('請輸入密碼')" />
			</view>
			<view class="personal_list">
				<view class="title">{{Lang.lang('確認密碼')}}:</view>
				<input type="password" placeholder-style="color: #A5A7AD" v-model="pwd_s" :placeholder="Lang.lang('請確認密碼')" />
			</view>

			<view class="confirm" @click="setPayPassword">{{Lang.lang('確定')}}</view>
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				lang: 'en',
				link: '',
				pupu: false,
				scrrol: false,
				info: '',
				pwd: '',
				pwd_s: ''
			}
		},
		onLoad() {

		},
		onShow() {
			// let that = this;
			//that.loadData();
		},
		methods: {
			setPayPassword() {
				let that = this;

				if (that.pwd != that.pwd_s) {
					that.Msg.Fail(that.Lang.lang('兩次密碼不一樣'));
					return;
				}

				that.Net._post('api/user/setPayPassword', {
					new_pwd: that.pwd
				}, res => {
					if (res.code == 200) {
						that.Msg.Success(res.msg)
						setTimeout(function() {
							that.backPage()
						}, 500)

					}
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},
		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
	}
</script>

<style>
	.header {
		background-color: transparent !important;
	}

	.header .text {
		text-align: center;
	}

	.page_content {
		width: 92%;
		margin: 0 auto;
	}

	.scrrolHeader {
		width: 100%;
		background-color: #1A1A1A !important;

	}

	.personal_list {
		width: 100%;
		height: 50px;
		margin: 3vw auto 0vw;
		padding: 0vw 3vw;
		display: flex;
		background-color: #F9F9F9;
		border-radius: 2vw;
		position: relative;
	}

	.personal_list .title {
		height: 50px;
		line-height: 50px;
		font-size: 3.5vw;
		color: #000;
		margin-right: 10px;
		width: 25%;
	}

	.personal_list input {
		height: 50px;
		line-height: 50px;
		font-size: 3.5vw;
		color: #000;
		width: calc(100% - 150px);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.personal_list .yzm {
		text-align: right;
		line-height: 30px;
		height: 30px;
		font-size: 3.5vw;
		color: #fff;
		background-color: #0084FF;
		border-radius: 10px;
		overflow: hidden;
		padding: 0vw 2vw;
		margin-top: 3vw;
	}

	.yzm1 {
		line-height: 50px;
		height: 50px;
		font-size: 12px;
		color: gray;
	}

	.modify {
		width: 90%;
		height: 45px;
		line-height: 45px;
		font-size: 16px;
		color: #ffffff;
		text-align: center;
		background-color: #0084FF;
		margin: 0 auto;
		font-size: 3.5vw;
		margin-top: 20px;
		border-radius: 45vw;
		position: fixed;
		bottom: 3vw;
		left: 5%;
	}

	.hand {
		width: 90%;
		margin: auto;
	}

	.hand .ti_01 {
		color: #0ef0ec;
		font-size: 18px;
		margin-bottom: 3vw;
	}
</style>